using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Tip_TipListMap : EntityTypeConfiguration<Tip_TipList>
    {
        public Tip_TipListMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Module)
                .HasMaxLength(50);

            this.Property(t => t.Project)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Image)
                .HasMaxLength(50);

            this.Property(t => t.Code)
                .HasMaxLength(50);

            this.Property(t => t.Link)
                .HasMaxLength(100);

            this.Property(t => t.Icon)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Tip_TipList");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.tip).HasColumnName("tip");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Module).HasColumnName("Module");
            this.Property(t => t.Project).HasColumnName("Project");
            this.Property(t => t.Image).HasColumnName("Image");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Link).HasColumnName("Link");
            this.Property(t => t.Icon).HasColumnName("Icon");
            this.Property(t => t.Importance).HasColumnName("Importance");
        }
    }
}
